package com.lxl.securitypermission.pojo;

import java.util.Collection;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

/**
 * @author 绫小路
 * @date 2020/12/29 23:51
 * @description 继承security的user 以自定义更多属性
 */

public class SecUser extends User {
  public SecUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
    super(username, password, authorities);
  }

  private Integer id;
  private String username;
  private String nickname;

  public Integer getId() {
    return id;
  }

  public void setId(Integer id) {
    this.id = id;
  }

  @Override
  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getNickname() {
    return nickname;
  }

  public void setNickname(String nickname) {
    this.nickname = nickname;
  }

  @Override
  public String toString() {
    return "SecUser{" +
        "id=" + id +
        ", username='" + username + '\'' +
        ", nickname='" + nickname + '\'' +
        '}';
  }
}
